<?php

use yii\grid\GridView;
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '力度规则';
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
    .power-index img{width:80px;height:80px;margin-right:10px;}
</style>
<div class="power-index">
    <?= $this->render('_search', ['model' => $searchModel]) ?>
    <div class="box box-primary">
        <div class="box-body">
            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'columns' => [
                    'id',
                    'times_low',
                    'times_up',
                    [
                    'attribute' => 'power',
                    'value' => function($model){
                    return \common\helpers\Util::getPowerName($model->power);
                    }
                    ],
                    [
                    'attribute' => 'type',
                    'value' => function($model){
                        $type = array();
                        $type[1] = "单次设置";
                        $type[2] = "范围设置";
                        return $type[$model->type]; 
                    }
                    ],
                    'timestamp',
                    [
                        'class' => 'yii\grid\ActionColumn',
                        'template' => '{update} {delete} ',
                        'buttons' => [
                            
                        ]
                    ],
                ],
            ]); ?>
        </div>
    </div>

</div>
<?php $this->beginBlock('js') ?>
<script>
    layer.ready(function () {
        layer.photos({
            photos:'.comment-index',
            shift:5
        });
    })
</script>
<?php $this->endBlock() ?>
